package com.jxc.action.qxgl;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.jxc.action.BaseAction;
import com.jxc.model.vo.VResource;
import com.jxc.service.ResourceServiceI;
import com.opensymphony.xwork2.ModelDriven;

@Namespace("/qxgl")
@Action(value = "resourceAction")
public class ResourceAction extends BaseAction implements ModelDriven<VResource> {

	private static final Logger logger = Logger.getLogger(ResourceAction.class);

	private VResource model = new VResource();
	@Autowired
	private ResourceServiceI resourceServide;

	public VResource getModel() {
		return model;
	}

	/**
	 * 获得权限树
	 */
	public void tree() {
		super.writeJson(resourceServide.tree(model, false));
	}

	public void noAuth_treeResource() {
		super.writeJson(resourceServide.tree(model, true));
	}

	/**
	 * 获得权限treegrid
	 */
	public void treegrid() {
		super.writeJson(resourceServide.treegrid(model));
	}

}
